<%-- 
    Document   : delete_student
    Created on : Dec 10, 2011, 8:27:04 PM
    Author     : THIENSUHACK
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="java.util.LinkedList"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.util.List"%>
<%@page import="java.util.Calendar"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="GetData.DataWS"%>
<%@page import="DTO.sinhvien"%>

<%
if(request.getParameter("type")!=null)
       {
    String delStr=request.getParameter("type").toString();
         if(delStr.length()>0){ 
          delStr=delStr.substring(0,delStr.length()-1); 
         } 
         String  masv[]=delStr.split(",");
         if(masv.length>0)
             {
             DataWS a=new DataWS();
             for(int i=0;i<masv.length;i++)
                {
                 if(a.xoasinhvien(masv[i].toString())>0)
                                         {
                     out.print("Xóa thành công:"+masv[i].toString()+"--");
                 }
                 else
                                         {
                     out.print(" THẤT BẠI:"+masv[i].toString()+"--");
                 }
             }
         }
         
}

if(request.getParameter("id")!=null)
       {
    String masv=request.getParameter("id");
    DataWS a=new DataWS();
    if(a.xoasinhvien(masv)>0)
               {
        out.print("Xóa thành công");
        response.sendRedirect("/DKTC/admin/index.jsp?page=list_student");
    }
    else
               {
        out.print("Xóa thất bại");
    }
}
else
       {
   response.sendRedirect("/DKTC/admin/index.jsp?page=list_student");
}


%>
<div><a href="/DKTC/admin/index.jsp?page=list_student"> << Trở lại danh sách</a></div>